﻿using System;
using System.Collections.Generic;
using System.Text;
using System.ComponentModel;
using Org.Eurekaa.DNJ.UI.Common;
using Org.Eurekaa.DNJ.Settings;

namespace Org.Eurekaa.DNJ.UI.DNJSettings
{
    [Serializable()]
    public class DNJAccordionSettings : GenericSettingsObject
    {
        [Description("Choose your favorite animation type.")]
        [DefaultValue(""), NotifyParentProperty(true), RefreshProperties(RefreshProperties.Repaint)]
        public EnmEasingMethod Animation
        {
            get { return this.Get<EnmEasingMethod>("animated"); }
            set { this["animated"] = value; }
        }
        [Description("The event on which to trigger the accordion.")]
        [DefaultValue(""), NotifyParentProperty(true), RefreshProperties(RefreshProperties.Repaint)]
        public EnmJSEvents Event
        {
            get { return this.Get<EnmJSEvents>("event"); }
            set { this["event"] = value; }
        }

        [Description("If set, the highest content part is used as height reference for all other parts. Provides more consistent animations.")]
        [DefaultValue(true), NotifyParentProperty(true), RefreshProperties(RefreshProperties.Repaint)]
        public bool AutoHeight
        {
            get { return this.Get<bool>("autoHeight"); }
            set { this["autoHeight"] = value; }
        }

        [Description("If set, clears height and overflow styles after finishing animations. This enables accordions to work with dynamic content. Won't work together with autoHeight.")]
        [DefaultValue(false), NotifyParentProperty(true), RefreshProperties(RefreshProperties.Repaint)]
        public bool ClearStyle
        {
            get { return this.Get<bool>("clearStyle"); }
            set { this["clearStyle"] = value; }
        }

        [Description("If set, the accordion completely fills the height of the parent element. Overrides autoheight.")]
        [DefaultValue(false), NotifyParentProperty(true), RefreshProperties(RefreshProperties.Repaint)]
        public bool FillSpace
        {
            get { return this.Get<bool>("fillSpace"); }
            set { this["fillSpace"] = value; }
        }

        [Description("If set, looks for the anchor that matches location.href and activates it. Great for href-based state-saving. Use navigationFilter to implement your own matcher.")]
        [DefaultValue(false), NotifyParentProperty(true), RefreshProperties(RefreshProperties.Repaint)]
        public bool Navigation
        {
            get { return this.Get<bool>("navigation"); }
            set { this["navigation"] = value; }
        }

        [Description("Whether all the sections can be closed at once. Allows collapsing the active section by the triggering event (click is the default).")]
        [DefaultValue(false), NotifyParentProperty(true), RefreshProperties(RefreshProperties.Repaint)]
        public bool Collapsible
        {
            get { return this.Get<bool>("collapsible"); }
            set { this["collapsible"] = value; }
        }

        public DNJAccordionSettings()
        {
            AutoHeight = true;
            Animation = EnmEasingMethod.slide;
        }


    }

}
